#-
# ==========================================================================
# Sparticlus Makefile, to be used the buildConfig for the compilation
# of Sparticlus, a plugin for Autodesk Maya that performs particle
# simulation on the GPU.
==========================================================================
#+

#
# Include platform specific build settings
#
include buildconfig

.SUFFIXES: .cpp .cc .o .so .c .bundle 

.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $<
	
.cc.o:
	$(C++) -c $(INCLUDES) $(C++FLAGS) $<

.cpp.o:
	$(C++) -c $(INCLUDES) $(C++FLAGS) $<

.cc.i:
	$(C++) -E $(INCLUDES) $(C++FLAGS) $*.cc > $*.i

.cc.so:
	-rm -f $@
	$(LD) -o $@ $(INCLUDES) $< $(LIBS)

.cpp.so:
	-rm -f $@
	$(LD) -o $@ $(INCLUDES) $< $(LIBS)

.o.so:
	-rm -f $@
	$(LD) -o $@ $< $(LIBS)

.o.bundle:
	-rm -f $@
	$(LD) -o $@ $< $(LIBS)

LINUX_PLUGINS = \
		fluidInfoCmd.$(EXT)				\
		pfxInfoCmd.$(EXT)

plugins: \
		$(PLATFORM_SPECIFIC_PLUGINS)	\
		sparticlus.$(EXT)			\			

ribExport.$(EXT): ribExport.o
	-rm -f $@
	$(LD) -o $@ ribExport.o \
		$(LIBS) -lOpenMayaUI -lOpenMayaAnim \
		-L$(RMANTREE)/lib -lrib -ltarget -lprmutil -lzip

ribExport.o: ribExport.cpp
	$(C++) -c $(INCLUDES) -I$(RMANTREE)/include $(C++FLAGS) $<


depend:
	makedepend $(INCLUDES) -I/usr/include/CC *.cc

clean:
	-rm -f *.o

Clean:
	-rm -f *.o *.so *.lib *.bak *.bundle

##################
# Specific Rules #
##################

sparticlus.$(EXT): sparticlus.o
	-rm -f $@
	$(LD) -o $@ $? $(LIBS) -lOpenMayaFx -lOpenMayaUI
